// $Id$
// Licensed under Apache License Version 2.0
// See: http://www.apache.org/licenses/LICENSE-2.0.html
package de.servicezombie.errors;

import java.util.Arrays;

public class ErrorMessage {

	private String key;
	private Object source;
	private Object[] args;

	public ErrorMessage(String key, Object... args) {
		this.key = key;
		this.args = args;
	}

	public Object getSource() {
		return source;
	}

	public ErrorMessage attachSource(Object source) {
		this.source = source;
		return this;
	}
	
	public String getKey() {
		return key;
	}

	public Object[] getArgs() {
		return args;
	}

	@Override
	public String toString() {
		return "ErrorMessage [key=" + key + ", source=" + source + ", args=" + Arrays.toString(args) + "]";
	}

	
	
}
